package cn.hy.controller;

import cn.hy.response.R;
import cn.hy.sign.Signature;
import cn.hy.vo.UserVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "签名接口",value = "sign")
@RestController
@RequestMapping("sign")
public class SignTestController {

    @Signature
    @PostMapping("test/{id}")
    @ApiOperation("mySign test")
    public R<String> mySign(@PathVariable String id
            , @RequestParam String client
            , @RequestBody UserVo user) {
        return R.success(String.join(",", id, client, user.toString()));
    }

}
